package ingest.wiktionary;


import ingest.wiktionary.dal.MongoIngestor;

import java.util.Iterator;
import java.util.List;

public class IngestAndTransform {

	private static String WIKTIONARY_FILE = "/local/wiktionary/en-dump.xml";
	private static String IDIOMS_FILE = "idioms.txt";
	private static String LANGUAGE = "English";
	private static String ISO_LANGUAGE = "en";

	public static void main(String[] args) {
//
////		// Ingest into mongo
		MongoIngestor m = new MongoIngestor(WIKTIONARY_FILE, IDIOMS_FILE);
		m.ingest(false);
////
////		// Transform by adding more alternate forms
//		WiktionaryDB wikiDB = WiktionaryDB.getInstance();
////		List<WiktionaryEntry> entries = wikiDB
////				.getAllEntriesByLanguage(LANGUAGE);
////		AlternateFormCreator formCreator = new AlternateFormCreator();
////		for (WiktionaryEntry e : entries) {
////			List<String> forms = formCreator.createAlternateForms(e.getIdiom());
////			for (String s : forms) {
////				wikiDB.update(e, "alternativeForms", s);
////			}
////		}
//
////		// we need to the entries again because we updated
//		List<WiktionaryEntry> entries = wikiDB.getAllEntriesByLanguage(LANGUAGE);
////		// also get the sentences to annotate
//		CorporaDB corpDB = CorporaDB.getInstance();
//		Iterator<SentenceGroup> sentenceIterator = corpDB.getEntriesIterator();
////
////		// now annotate the text for occurences of the every wiktionary entry
//		MetaphorAnnotator annotator = new MetaphorAnnotator(sentenceIterator, entries);
//		 annotator.annotateSentencesInLanguage(ISO_LANGUAGE);

	}
}
